/********************************************************************
Name: Table 4: Effect of Dem Sheriff on Compliance Rate, 
	Term Limited v Non-Term Limited
Author: Dan Thompson
Date: August 2019
Notes:
********************************************************************/

* Set the working directory 
gl root = "$sanctuary_root"
gl root = "YOUR_WORKING_DIRECTORY"

* Bring in the panel data
use "$root/data/panel analysis data.dta", clear
keep if inlist(state, "NM", "IN", "CO")

* Remove the one candidate who switches parties
egen sd_dem = sd(dem), by(candidate_id)
drop if sd_dem!=0

* Column 1
reg share_detained_sheriff dem_term dem term_limited, vce(cluster county_id)

* Column 2
reg share_detained_sheriff dem_term dem term_limited i.year, vce(cluster county_id)

* Column 3
reg share_detained_sheriff dem_term dem term_limited i.year log_foreign pres00_dem, ///
	vce(cluster county_id)

* Column 4
reg share_detained_sheriff dem_term dem term_limited i.year i.county_id, vce(cluster county_id)

